GBML manual / Using the editor

What goes into the ROM, and how to pin something

Only the assets your project can actually reach are staged into a build - and how to keep one around anyway.

Reachability, not "everything in the folder"

A build does not simply compile every file sitting in your project's assets/ folder - it stages only what the project can actually reach: the room order, the objects those rooms place, the assets those objects and the project's own settings name (the starting room, the save icon, the fonts), and anything explicitly pinned - then closes over whatever that reaches in turn (an object created in code, a script called, an effect spawned, a song requested, a path followed). An asset that nothing in the project ever names does not ship, even if it is sitting right there in the folder.

This matters because the Game Boy Advance module's own link step does not garbage-collect unused sections - an asset that is present in the directories a build lists is paid for whether or not anything actually uses it. Reachability analysis is what keeps a growing asset folder from bloating every build with art and audio nothing in the game plays any more. As one real example of the gap this closes: an early version of this project's own author's game, IGUN, shipped with over 11 MB of source audio that nothing in the game referenced at all, and one single soundbank asset alone accounted for 89.5% of the finished ROM's size - exactly the kind of thing reachability analysis surfaces in the build report rather than leaving to be discovered by chance.

A mistake is a build error, not a silent hole

Every asset reference inside the generated code is a compile-time symbol, not a runtime string lookup - so misspelling a sprite name, or referencing one that was deleted, fails the build with the name it could not resolve rather than shipping a ROM with a blank spot where that asset should have been.

Pinning something the build did not notice

The build finds what your game uses by looking in two places:

  1. Your project's own files. The rooms, the objects they place, and the pictures, tilesets and sounds those name. This part is always right, and it always runs.
  2. Your GBML code. The build reads your scripts to find things that only code mentions, like a song a script plays. This part is a bonus. It can only ever add things to the list, never take one off. If it cannot run for some reason, the build does not stop. It says so in the build log and carries on with the first part alone.

So there are two times a pin helps. One is when that second look could not run, and something only your code uses got left out. The other is when you simply want an asset in the game for sure, even though nothing names it yet (you added the boss music before the boss exists, say).

A pin is a tick that says "keep this one, whatever the build thinks". It is saved in your project file, which is the part that always runs, so a pin works even on a day the code check does not.

There are two places to pin, and they do exactly the same thing:

A pin changes the game from the next build on.

Comparing against everything

Project settings has an Include everything in the build switch, for when you want to compare a fully-included build against the reachability-trimmed one - useful for sanity-checking that reachability analysis is not accidentally dropping something you actually need, rather than something you are happy to see trimmed.

The report

Every build's own report says what was included, what was left out and why, the finished ROM size, and the biggest things in it - the same information the example above is drawn from, but for your own project, every time you build.

See also: Building and reading its problemsDevelopment Build and Release BuildRooms